package ch.usi.inf.pf2.alu.nodes;

/**
 * This is an identifier node, it implements the Log in base 10 function
 * 
 * @author Thomas Mantegazzi
 * 
 */

public class LogNode extends IdentifierNode {

	public LogNode(Node[] arguments) throws WrongNumberOfArgumentsException {
		super(arguments);
		if (arguments.length > 1) {
			throw new WrongNumberOfArgumentsException(
					"Error: 'log()' expect only one argument: given <"
							+ arguments.length + "> arguments");
		}
	}

	protected double compute(double[] args) {
		return Math.log10(args[0]);
	}

}
